(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[879],{6109:(e,r,t)=>{Promise.resolve().then(t.t.bind(t,2619,23)),Promise.resolve().then(t.t.bind(t,6796,23)),Promise.resolve().then(t.bind(t,9203))},6796:e=>{e.exports={authPage:"AuthForm_authPage__M9FiQ",authShell:"AuthForm_authShell__QnGCj",rise:"AuthForm_rise__vuGPD",brandRow:"AuthForm_brandRow__aGRWo",brand:"AuthForm_brand__quahE",brandGlyph:"AuthForm_brandGlyph__qA7AD",kicker:"AuthForm_kicker__6mKy1",blink:"AuthForm_blink__qVFkY",panel:"AuthForm_panel__4Izbk",panelBar:"AuthForm_panelBar__4ymSX",dots:"AuthForm_dots__SPlqI",panelTitle:"AuthForm_panelTitle__L63Ro",panelBody:"AuthForm_panelBody__2uO8f",title:"AuthForm_title__0zwBF",lede:"AuthForm_lede__uhdb_",authForm:"AuthForm_authForm__dIoLT",termsLabel:"AuthForm_termsLabel__VVhmX",altAction:"AuthForm_altAction__xBv2l",backLink:"AuthForm_backLink__Ej2c9",error:"AuthForm_error__Y9YZS",banner:"AuthForm_banner__ojgAL",notice:"AuthForm_notice__7dQye"}},9203:(e,r,t)=>{"use strict";t.d(r,{SignupForm:()=>o});var a=t(5155),n=t(2115),i=t(6796),s=t.n(i);function o(){let[e,r]=(0,n.useState)(""),[t,i]=(0,n.useState)(""),[o,l]=(0,n.useState)(""),[u,h]=(0,n.useState)(!1),[_,c]=(0,n.useState)({kind:"idle"});async function d(r){var a;r.preventDefault(),c({kind:"submitting"});let n=await fetch("/api/auth/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t,displayName:o,terms:u})});if(201===n.status)return void c({kind:"success"});c({kind:"error",message:"string"==typeof(a=await n.json().catch(()=>({}))).error&&a.error?a.error:"string"==typeof a.field&&a.field?"Check your ".concat(a.field,"."):"Signup failed. Please try again."})}return"success"===_.kind?(0,a.jsx)("p",{role:"status",className:s().notice,children:"Account created — check your email for a verification link to activate submissions."}):(0,a.jsxs)("div",{className:s().authForm,children:["error"===_.kind&&(0,a.jsx)("p",{role:"alert",className:s().error,children:_.message}),(0,a.jsxs)("form",{onSubmit:d,children:[(0,a.jsx)("label",{htmlFor:"signup-email",children:"Email"}),(0,a.jsx)("input",{id:"signup-email",type:"email",required:!0,value:e,onChange:e=>r(e.target.value)}),(0,a.jsx)("label",{htmlFor:"signup-password",children:"Password"}),(0,a.jsx)("input",{id:"signup-password",type:"password",required:!0,minLength:8,value:t,onChange:e=>i(e.target.value)}),(0,a.jsx)("label",{htmlFor:"signup-display-name",children:"Display name"}),(0,a.jsx)("input",{id:"signup-display-name",type:"text",required:!0,pattern:"[A-Za-z0-9 ]{1,30}",maxLength:30,value:o,onChange:e=>l(e.target.value)}),(0,a.jsxs)("label",{htmlFor:"signup-terms",className:s().termsLabel,children:[(0,a.jsx)("input",{id:"signup-terms",type:"checkbox",required:!0,checked:u,onChange:e=>h(e.target.checked)}),(0,a.jsxs)("span",{children:["I agree to the"," ",(0,a.jsx)("a",{href:"https://surface-security.com/terms",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})," ","and"," ",(0,a.jsx)("a",{href:"https://surface-security.com/privacy",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"."]})]}),(0,a.jsx)("button",{type:"submit",disabled:"submitting"===_.kind,children:"Sign up"})]}),(0,a.jsxs)("p",{className:s().altAction,children:["Already have an account? ",(0,a.jsx)("a",{href:"/login",children:"Log in"})]})]})}}},e=>{e.O(0,[0,619,441,255,358],()=>e(e.s=6109)),_N_E=e.O()}]);